tempVal = null;
}
Timestamp fromDate = UtilDateTime.nowTimestamp();
if (tempVal != null) {
// exists already with valid date, show warning
// required parameters
String contactMechId = (String) context.get("contactMechId");
String contactMechPurposeTypeId = (String) context.get("contactMechPurposeTypeId");
Timestamp fromDate = (Timestamp) context.get("fromDate");
GenericValue tempVal = null;
try {
Map<String, String> pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId);
//Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module);
List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true);
tempVal = EntityUtil.getFirst(allPCMPs);
} catch (GenericEntityException e) {
Debug.logWarning(e.getMessage(), module);
tempVal = null;
}
if (UtilValidate.isEmpty(fromDate)) {
fromDate = UtilDateTime.nowTimestamp();
}
if (tempVal != null) {